package controller;

import java.util.HashMap;
import java.util.Map;

public class BagValidator {

    public Map<String, String> validate(String type, String price) {
        Map<String, String> map = new HashMap<String, String>();
        if (type.length() > 100) {
            map.put("type", "name is too long");
        }
        try {
            int intPrice = Integer.parseInt(price);
        } catch (Exception e) {
            map.put("price", "price must be numeric");
        }

        return map;
    }
}
